﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _5._18
{
    public partial class Insert : Form
    {
        public Insert()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string name = this.tex_name.Text.Trim();
            string type = this.tex_Type.Text.Trim();
            string Amount = this.tex_Amount.Text.Trim();
            string price = this.tex_price.Text.Trim();
            string sql = string.Format("insert T_GoodsInto values('{0}','{1}',{2},{3})", name, type, Amount, price);
            int rs = DBHelper.write(sql);
            if (rs > 0)
            {
                MessageBox.Show("添加成功......");
            }else
            {
                MessageBox.Show("添加失败......");
            }
        }

        private void Insert_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
          
        }
    }
}
